package com.xingyun.info_manager.service.impl;

import com.xingyun.info_manager.dao.AdminInfoDao;
import com.xingyun.info_manager.entity.AdminUser;
import com.xingyun.info_manager.entity.ParasBean;
import com.xingyun.info_manager.service.IAdminUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("adminInfoService")
public class AdminInfoServiceImpl implements IAdminUserService {

	@Autowired
	private AdminInfoDao adminInfoDao;

	/**
	 * 查询用户是否存在
	 * @param userName
	 * @param userPwd
	 * @return
	 */
	@Override
	public AdminUser findByNamePwd(String userName, String userPwd,int channelId) {
		return adminInfoDao.findByNamePwd(userName, userPwd, channelId);
	}

	@Override
	public List<AdminUser> findAllUser(ParasBean parasBean) {
		return adminInfoDao.findAllUser(parasBean);
	}

	@Override
	public int findCount(ParasBean parasBean) {
		return adminInfoDao.findCount(parasBean);
	}

	@Override
	public int addAdmin(AdminUser adminUser) {
		return adminInfoDao.addAdmin(adminUser);
	}

	@Override
	public AdminUser findById(int userId) {
		return adminInfoDao.findById(userId);
	}

	@Override
	public int updateAdmin(AdminUser adminUser) {
		return adminInfoDao.updateAdmin(adminUser);
	}

	@Override
	public int changeState(AdminUser adminUser) {
		return adminInfoDao.changeState(adminUser);
	}

	@Override
	public int delAdmin(int userId) {
		return adminInfoDao.delAdmin(userId);
	}

	@Override
	public int getInfoByAdminChannelNo(String userName, int channelId, int userId) {
		return adminInfoDao.getInfoByAdminChannelNo(userName,channelId,userId);
	}
}
